import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { ObjCreate } from "../../common/ObjCreate";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { ArenaGroupData } from "../ArenaData/ArenaGroupData";
import { ObjTeamCreate } from "../../common/ObjTeamCreate";
import { GButton } from "../../../../../com/mui/controls/GButton";
//class ArenaGroupMiniResult
    
    export  class ArenaGroupMiniResult /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            var loc1=new GTextFormat(FontUtil.songtiName, 14, 15788607);
            this._tfName = ObjCreate.createTextField("", 70, 12, 120, 22, this, loc1);
            this._tfGroupLen = ObjCreate.createTextField(Language.getString(42260), 70, 35, 120, 22, this, GlobalStyle.textFormat2);
            this._tfPower = ObjCreate.createTextField("", 30, 55, 130, 20, this);
            this._tfTotalHurt = ObjCreate.createTextField("", 30, 72, 130, 20, this);
            this._tfTotalCure = ObjCreate.createTextField("", 30, 90, 130, 20, this);
            this._tfScoreReward = ObjCreate.createTextField(Language.getStringByParam(42236, "0"), 22, 115, 150, 22, this, loc1);
            this._btnShowFriends = ObjCreate.createGButton(Language.getString(42261), 22, 135, 96, 22, this);
            this._btnShowFriends.addEventListener(flash.events.MouseEvent.CLICK, this.onMouseClick);
            return;
        }

        /* internal  */onMouseClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaShowArenaGroupDetails));
            return;
        }

        public updateResult(arg1: ArenaGroupData): void
        {
            this._tfName.text = Language.getString(42262);
            ObjTeamCreate.setTextFieldKeyValue(this._tfPower, Language.getString(42263), arg1.averageCapabili.toString());
            ObjTeamCreate.setTextFieldKeyValue(this._tfTotalHurt, Language.getString(42264), arg1.totalHurt.toString());
            ObjTeamCreate.setTextFieldKeyValue(this._tfTotalCure, Language.getString(42265), arg1.totalCure.toString());
            this._tfScoreReward.text = Language.getStringByParam(42266, arg1.markInBattle.toString());
            return;
        }

        /* internal */ /* var */_tfName: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfGroupLen: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfPower: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfTotalHurt: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfTotalCure: Object /* flash.text.TextField */;

        /* internal */ /* var */_tfScoreReward: Object /* flash.text.TextField */;

        /* internal */ /* var */_btnShowFriends: GButton;
    }
